<?php
use yii\widgets\ActiveForm;
use yii\helpers\Html;

/** @var $form ActiveForm */
/** @var $key \app\models\ViewsTest */
?>

<?php $form = ActiveForm::begin(['id' => 'login-form']); ?>

<?= $form->field($key, 'username')->textInput() ?>

<?= $form->field($key, 'password')->textInput() ?>

<?= $form->field($key, 'password')->passwordInput() ?>

<?= $form->field($key, 'password')->radioList(['1'=>'男','0'=>'女']) ?>

<?= $form->field($key, 'password')->checkboxList(['0'=>'one','1'=>'two','3'=>'three']) ?>

<?= $form->field($key, 'password')->dropDownList([
    '0'=>'一级甲等',
    '1'=>'二级甲等',
    '2'=>'三级甲等',
]) ?>

<?= $form->field($key, 'password')->fileInput() ?>

<?= $form->field($key, 'password')->textarea(['rows'=>3]) ?>

//隐藏域
<?= $form->field($key, 'password')->hiddenInput(['values'=>3]) ?>

<?= Html::submitButton('提交', ['class'=>'btn btn-primary','name' =>'submit-button']) ?>

<div class="form-group">
    <?= Html::submitButton('Login') ?>
</div>

<?php ActiveForm::end(); ?>


<?php
use kartik\widgets\ActiveForm;
use kartik\builder\Form;
$form = ActiveForm::begin(['type'=>ActiveForm::TYPE_VERTICAL]);
echo Form::widget([
'model'=>$model,
'form'=>$form,
'columns'=>2,
'attributes'=>$model->formAttribs
]);
echo Html::button('Submit', ['type'=>'button', 'class'=>'btn btn-primary']);
ActiveForm::end();
